<div ng-controller="CustomformCtrl" ng-init="typeaddAction()" class="sui-form form-horizontal">
    <form name="customTypeForm" novalidate class="sui-form form-horizontal">
        <ul class="sui-breadcrumb">
            <li><a href="#/customform/typelist?form_id={{form_type.form_id}}">{{form_type.title | translate}}</a></li>
            <li class="active">{{form_type.type_id?'edit':'add_new' | translate}}</li>
        </ul>
        <div class="control-group">
            <label class="control-label v-top">{{'选项名称' | translate}}:</label>
            <div class="controls">
                <input id="title" type="text" name="title" ng-model="form_type.title" />
            </div>
        </div>
        <div class="control-group">
            <label class="control-label v-top">{{'选项说明' | translate}}:</label>
            <div class="controls">
                <textarea rows="3" ng-model="form_type.title_msg" class="input-xlarge"></textarea>
            </div>
        </div>
        <div class="control-group">
            <label class="control-label v-top">{{'选项类型'|translate}}:</label>
            <div class="controls">
                <label>
                    <select ng-model="form_type.type"
                        ng-options="types.type as types.name for types in form_types"></select>
                </label>
            </div>
        </div>
        <div class="control-group"
            ng-show="form_type.type=='select' || form_type.type == 'checkbox' || form_type.type == 'radio'">
            <label class="control-label v-top">{{'表单选项' | translate}}:</label>
            <div class="controls">
                <table class="sui-table table-bordered" ng-show="form_type.options">
                    <thead>
                        <tr>
                            <th>选项名称</th>
                            <th>选项值</th>
                            <th>操作</th>
                        </tr>
                    </thead>
                    <tbody>
                        <tr ng-repeat="option in form_type.options track by $index">
                            <td>
                                <input type="text" class="input-medium" ng-model="option.option_name">
                            </td>
                            <td>
                                <input type="text" class="input-medium" ng-model="option.option_value">
                            </td>
                            <td>
                                <button class="sui-btn btn-primary" ng-click="delOption($index)">删除</button>
                            </td>
                        </tr>
                    </tbody>
                </table>
                <button class="sui-btn btn-primary" ng-click="addOptions();">+增加选项</button>
            </div>
        </div>
        <div ng-show="form_type.type != 'hide'">
            <div class="control-group" ng-show="form_type.type!='remark'">
                <label class="control-label v-top">{{'默认值' | translate}}:</label>
                <div class="controls">
                    <textarea rows="3" ng-model="form_type.default_value" class="input-xlarge"></textarea>
                </div>
            </div>
        </div>
        <div class="control-group" ng-show="form_type.type=='remark' || form_type.type=='hide'">
            <label class="control-label v-top">
                {{'默认值' | translate}}:
            </label>
            <div class="controls">
                <ueditor ng-model="form_type.default_value1" uid="beizhuintroduce" style="width:694px"></ueditor>
            </div>
        </div>
        <div class="control-group">
            <label class="control-label v-top">{{'排列顺序' | translate}}:</label>
            <div class="controls">
                <input id="sort" type="text" name="sort" ng-model="form_type.sort" />
                <div class="sui-msg msg-success msg-clear help-block">
                    <div class="msg-con">排列数字，数字越大，排序越靠后</div>
                    <s class="msg-icon"></s>
                </div>
            </div>
        </div>
        <div class="control-group">
            <label class="control-label v-top">是否必选:</label>
            <div class="controls">
                <label>
                    <input type="radio" name="ismust" ng-model="form_type.is_must" ng-value="1" class="input-xlarge"
                        required />是 </label>
                </label>
                <label>
                    <input type="radio" name="ismust" ng-model="form_type.is_must" ng-value="0" class="input-xlarge"
                        required />否 </label>
                </label>
            </div>
        </div>
        <div class="control-group">
            <label class="control-label v-top">是否启用:</label>
            <div class="controls">
                <label>
                    <input type="radio" name="display" ng-model="form_type.display" ng-value="1" class="input-xlarge"
                        required />是 </label>
                </label>
                <label>
                    <input type="radio" name="display" ng-model="form_type.display" ng-value="0" class="input-xlarge"
                        required />否 </label>
                </label>
            </div>
        </div>
        <div class="control-group">
            <label class="control-label v-top">卖家填写字段:</label>
            <div class="controls">
                <label>
                    <input type="radio" name="status" ng-model="form_type.status" ng-value="2" class="input-xlarge"
                        required />是 </label>
                </label>
                <label>
                    <input type="radio" name="status" ng-model="form_type.status" ng-value="1" class="input-xlarge"
                        required />否 </label>
                </label>
            </div>
        </div>

        <div class="control-group">
            <label class="control-label"></label>
            <div class="controls">
                <button type="submit" id="submit" class="sui-btn btn-primary" ng-click="customformTypeAdd()">
                    <span>{{'save'|translate}}</span>
                </button>
            </div>
        </div>
    </form>
</div>